<template>
  <div id="add-user">
    <div class="user-item">
      <div class="item-name">用户名：</div>
      <div class="item-value">
        <Input
          v-model="
            //eslint-disable-next-line
        user.username" size="large" />
      </div>
    </div>
    <div class="user-item">
      <div class="item-name">昵称：</div>
      <div class="item-value">
        <Input
          v-model="
            //eslint-disable-next-line
        user.realName" size="large" />
      </div>
    </div>
    <div class="user-item">
      <div class="item-name">密码：</div>
      <div class="item-value">
        <Input
          v-model="
            //eslint-disable-next-line
        user.password" size="large" />
      </div>
    </div>
    <div class="user-item">
      <div class="item-name">确认密码：</div>
      <div class="item-value">
        <Input
          v-model="
            //eslint-disable-next-line
        user.password2" size="large" />
      </div>
    </div>
    <div class="user-item">
      <div class="item-name">状态：</div>
      <div class="item-value">
        <Switch
          v-model="
            //eslint-disable-next-line
        user.enabled" size="large">
          <template #open>
            <span>启用</span>
          </template>
          <template #close>
            <span>停用</span>
          </template>
        </Switch>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "AddUser",
  props: {
    user: {
      type: Object,
      require: true,
    },
  },
};
</script>

<style scoped lang="less">
#add-user {
  .user-item {
    display: flex;
    flex-direction: row;
    height: 3rem;
    align-items: center;

    .item-name {
      font-size: 1rem;
      width: 5rem;
      text-align: left;
    }

    .item-value {
      width: 16rem;
      text-align: left;
    }
  }
}
</style>
